package demo16;

import java.util.List;

public class Main {
    public static void main(String [] args){
        Tree44 tree44=new Tree44();
      Tree44.TreeNode44 a= tree44.create4();
      System.out.println("层序遍历的结果1为：");
      tree44.levelorder(a);
      Tree44 tree441=new Tree44();
      Tree44.TreeNode44 b=tree44.create4();
      System.out.println();
      System.out.println("层序遍历的结果2为：");
      List< List<Character>> p=tree441.linkorder(b);
      System.out.println(p.toString());
      Tree44 tree442=new Tree44();
      Tree44.TreeNode44 head2=tree442.create4();
      System.out.println("利用队列判断这棵树是否是完全二叉树：");
      boolean m=tree442.isComp(head2);
      System.out.println(m+" ");
   Tree44 tree443=new Tree44();
   Tree44.TreeNode44 n=tree443.create4();
   Tree44.TreeNode44 ret=tree443.lowest(n,n.left,n.left.right);
   System.out.println("求祖先点为：");
   System.out.println(ret.val);
   Tree44 tree444=new Tree44();
   Tree44.TreeNode44 cur =tree444.create4();
   System.out.println("求两个节点中最近的一个祖先节点：");
  Tree44.TreeNode44 head= tree444.deal(cur,cur.left,cur.left.right);
   System.out.println(head.val);
    }
}
